//
//  ViewController.m
//  iOS多线程
//
//  Created by 崔博 on 2018/9/4.
//  Copyright © 2018年 崔博. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // GCD 同步执行任务函数
    dispatch_queue_t queue = dispatch_queue_create("queue", DISPATCH_QUEUE_SERIAL);
    dispatch_async(queue, ^{
        for (int i = 0; i < 10; i++) {
            NSLog(@"--同步执行任务0---%@",[NSThread currentThread]);
        }
    });
    // GCD 异步执行任务函数
    dispatch_async(queue, ^{
        for (int i = 0; i < 10; i++) {
            NSLog(@"--同步执行任务0---%@",[NSThread currentThread]);
        }
    });
}


@end
